package demo.database.H2;

import java.io.File;

import javax.sql.DataSource;

import com.titan.common.v8.interfaces.IEmpty;
import com.titan.core.utils.db.DataSourceUtils;
import com.titan.core.utils.db.JdbcUtils;
import com.titan.core.utils.debug.Timer;
import com.titan.core.utils.spring.SpringUtils;
import com.titan.core.web.utils.SpringBootUtils;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2ControlConfigDaoImpl;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2ControlDaoImpl;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2PageConfigDaoImpl;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2PageDaoImpl;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2SystemConfigDaoImpl;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2SystemDaoImpl;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2ThemeConfigDaoImpl;
import com.titan.services.ddm.v2.common.DaoImpl.Ddm2ThemeDaoImpl;
import com.titan.services.ddm.v2.common.domain.Ddm2ThemeDomain;
import com.titan.services.ddm.v2.models.Ddm2Utils;

public class 根据MariaDB创建H2数据库 {
    private static void run() throws Exception {
//        JdbcUtils.copyFromMysqlToH2("127.0.0.1", 3306, "s1601", "root", "S1601"
//                , "jdbc:h2:file:E:/HDJT/S1606/S1606", "root", "S1606"
//                , VariantTwo.$(S0103UserRowMapper.class, "s0103_user")
//                , VariantTwo.$(Ddm2M1102RowMapper.class, "s1601_material_category")
//                , VariantTwo.$(Ddm2M1103RowMapper.class, "s1603_material")
//                , VariantTwo.$(S1601MaterialCabinetRowMapper.class, "s1601_material_cabinet")
//                , VariantTwo.$(S1601MaterialDrawerRowMapper.class, "s1601_material_drawer")
//                , VariantTwo.$(S1601MaterialCellRowMapper.class, "s1601_material_cell")
//                );
    }


    public static void main(String[] args) {
        Timer timer = Timer.$();
        try {
            SpringBootUtils.initEnvironmentTitan(args);
            
            SpringUtils.register(Ddm2SystemDaoImpl.class);
            SpringUtils.register(Ddm2SystemConfigDaoImpl.class);
            SpringUtils.register(Ddm2ThemeDaoImpl.class);
            SpringUtils.register(Ddm2ThemeConfigDaoImpl.class);
            SpringUtils.register(Ddm2PageDaoImpl.class);
            SpringUtils.register(Ddm2PageConfigDaoImpl.class);
            SpringUtils.register(Ddm2ControlDaoImpl.class);
            SpringUtils.register(Ddm2ControlConfigDaoImpl.class);
            
            run();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            timer.print();
        }
    }
}
